﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Windows.Documents;
using MemoryDuosRankings;

namespace MemoryDuosInterfaz
{
    public partial class RankingIndividual : Form
    {
        DAL dal = DAL.Instance;
        Publicidad Publi { get; set; }
        
        public RankingIndividual()
        {
            InitializeComponent();
            Publi = new Publicidad(pictureBox1);
        }

        private void RankingIndividual_Load(object sender, EventArgs e)
        {

        //    dataGridFacil.DataSource = dal.GetRankings(0);
       //     dataGridNormal.DataSource = dal.GetRankings(1);
       //     dataGridDificil.DataSource = dal.GetRankings(2);
     //       dataGridCompeticion.DataSource = dal.GetRankings(3);
            var lista = dal.GetRankings(0);
          //  var texto = richTextBoxFacil.Rtf;
            var i = 1;
            foreach (var rnk in lista)
            {
               richTextBoxFacil.AppendText(i+" "+rnk.ToString()+"\n");
               i++;
               // texto += rnk.ToRTFString();
            }
          //  richTextBoxFacil.Rtf = texto;
             lista = dal.GetRankings(1);
              i = 1;
            //  var texto = richTextBoxFacil.Rtf;
            foreach (var rnk in lista)
            {
                richTextNormal.AppendText(i + " " + rnk.ToString() + "\n");
                i++;
                // texto += rnk.ToRTFString();
            }
            lista = dal.GetRankings(2);
             i = 1;
            foreach (var rnk in lista)
            {
                richTextDificil.AppendText(i + " " + rnk.ToString() + "\n");
                i++;
                // texto += rnk.ToRTFString();
            }

            lista = dal.GetRankings(3);
             i = 1;
            foreach (var rnk in lista)
            {
                richTextCompeticion.AppendText(i + " " + rnk.ToString() + "\n");
                i++;
                // texto += rnk.ToRTFString();
            }
        }

        private void buttonReiniciar_Click(object sender, EventArgs e)
        {
            dal.LimpiarRankings();
            this.RankingIndividual_Load(sender, e);
        }


        private void pictureBox1_Click(object sender, EventArgs e)
        {
            Publi.cargarEnlaces();
        }

        private void richTextBoxFacil_TextChanged(object sender, EventArgs e)
        {

        }
    }
}
